#ifndef __SSD1306_H
#define __SSD1306_H

#include "IIC.h"
#include "strPicRes.h"

// 复位键引脚定义
#define OLed_Reset_PIN_RTC             Led2_RTC
#define OLed_Reset_PinPort             Led2_PinPort
// 复位键Pin:OLED
#define OLed_Reset_PinId               Led2_1PinId

#define pixel_height      64
#define pixel_width       128

// 第一种，分别定义读写设备地址
#define OLED_WRITE_ADDR  0x78
#define OLED_READ_ADDR   0x79

// 第二种，定义基础地址，通过改变该写位来改变地址
#define OLED_ADDR        0x78
#define OLED_WRITE       0x00
#define OLED_READ        0x01

#define OLED_CMD         1	  //命令
#define OLED_DAT         0	  //数据
//显示屏宽高
#define OLED_WIDTH 	  72
#define OLED_HEIGH 	  40
#define PAGES_NUM 	  5
// 显示屏：SEG起止
#define OLED_SEG_start 	  28
#define OLED_SEG_end   	  99
// 显示屏：COM起止
#define OLED_COM1_start   0
#define OLED_COM1_end  	  19
#define OLED_COM2_start   32
#define OLED_COM2_end  	  51


//OLED显存大小
#define OLED_MEM_SIZE     360    //(OLED_WIDTH * OLED_HEIGH / 8) 

void oled_reset_Pin_init(void);
//extern unsigned char GDDRAM[OLED_MEM_SIZE];
#ifndef UsingFreeRTOS
void ssd1306_init(void);
void oled_reset_step_run(void);
#endif
void oled_register_config(void);
//void oled_refresh(unsigned char mem[]);
void refreshOled(void);
void insertOneString(uint8_t x,uint8_t y,char *str,uint8_t strLen);
void insertOneString2(uint8_t x,uint8_t y,char *str,uint8_t strLen);
//void insertOnePic(uint8_t x,uint8_t y,char pic[3][24],uint8_t xLen,uint8_t yLen);
//void Oled_ShowString(u8 x,u8 y,u8 *chr,u8 strSize);
//void Oled_ShowChar(u8 x,u8 y,u8 chr);
//void Oled_Clear(void);
void insertOneChar(uint8_t x,uint8_t y,uint8_t charId);

#endif
